﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AvalonDock;
using System.Collections.ObjectModel;
using GalaSoft.MvvmLight.Messaging;
//using QinTools.Messages;
using QinTools.ViewModel.Documents;

namespace QinTools.View
{
    public class DocumentAdapter 
    {
        #region Properties
        public ReadOnlyObservableCollection<DocumentContent> DocumentViews { get; private set; }
        private ObservableCollection<DocumentContent> _DocumentViews;
        #endregion

        public DocumentAdapter()
        {
            //Messenger.Default.Register<DocumentAddedMessage>(this, DocumentAdded);
            _DocumentViews = new ObservableCollection<DocumentContent>();
            DocumentViews = new ReadOnlyObservableCollection<DocumentContent>(_DocumentViews);
        }

        //public void DocumentAdded(DocumentAddedMessage msg)
        //{
        //    var view = GetViewForType(msg.AddedDocument);
        //    view.DataContext = msg.AddedDocument;
        //    _DocumentViews.Add(view);
        //}

        private DocumentContent GetViewForDocumentType(Document doc)
        {
            if (doc is CharacterDocument)
            {
                return new CharacterView();
            }
            return new DocumentContent();
        }
    }
}
